nicole_g<- 16+16+16+17+8.3+9.4
nicole_g
hayden<- 18+17.8+16+18+7.5+9.3
hayden
lauren<- 17.8+16.5+15+13+8+9.4
lauren
maura<- 18+18.5+18+19+9.3+9.4
maura
joe<- 17.5+18+18+18.7+8.2+9.4
joe
joe-3
samy<- 18.5+17.3+17+18.5+8.8+9.2
samy
alvaro<- 19+18+16.5+18.5+8.8+9.5
alvaro
nicole_g<- 16+16+16+17+8.5+9.4
nicole_g
hayden<- 18+17.8+16+18+7.8+9.3
hayden
lars<- 18.5+16+15+17+7.8+8.5
lars
lars-1.5
lauren<- 17.8+16.5+15+13+8.8+9.4
lauren
lauren-3
joe<- 17.5+18+18+18.7+8.8+9.4
joe
joe-3
olivia<- 17.5+18.75+18.5+18.5+8.9+9.4
olivia
q()
(95*.25)+(89.72*.25)+(89.3*.25)+(96.05*.1)+(93*.15)
(96*.25)+(93.11*.25)+(92.25*.25)+(97.4*.1)+(95*.15)
q()
8.15*3500
8.15*6000
5.25*4500
5.25*3500
18375+23625+48900
60*100
60*20
190000-95041
27000/2
13500*9
121500*1.03
125145/9
14000*3
15/60
.25*15
1-.73
1-.55
.73-.27
.55-.45
27.95+29.95+31.95+29.95+32.95
(87+84)/2
(93+94)/2
(89+86)/2
(89+85)/2
428/60
.333*428
.33*428
141/60
900/60
27/500
141/60
120/60
q()
q()
p_na<- c(484+547+319+73)
p_na<- c(484,547,319,73)
p_a<- c(463, 529, 314, 74)
73/(sum(p_na))
74/sum(p_a)
(74+319)/sum(p_na)
(74+314)/sum(p_a)
g_na<- c(858, 1363, 1351, 539)
g_a<- c(812, 1364, 1277, 586)
539/sum(g_na)
586/sum(g_a)
(539+1351)/sum(g_na)
(586+1277)/sum(g_a)
q()
6*5
18/20
.9-.3
17.75/20
.8875-.3
.59*20
17.75/20
.8875-(7*.05)
.8875-(6*.05)
0.5875*20
28/30
.9*30
26/30
32/40
.85*40
36/40
27/30
28.30
28/30
33/40
28.5/30
27.5/30
27/30
5982/(5982+1059)
1175+344
1175+344+8+112+84+377
1519/2100
(377+112)/(377+112+84+8)
.91(20)
.91*20
.90*30
28/30
19/20
.86*30
.88*30
.85*30
16/20
.88*30
26/30
28/30
16/20
.88*30
.9*15
19.20
19/20
18.8/20
.93*35
.92*15
.94*35
q()
17.5/20
13/15
17/20
17.3/20
.86*35
14/15
18/20
18.2/20
.88*25
/88*35
.88*35
30./35
30.1/35
91.2-5
12.75/15
14.5/20
.93*15
17.3/20
14.5/20
17.2
17.2/20
33/35
13.8/15
13/15
13.5/15
17/20
30.1/35
30.2/35
.87*35
30.3/35
30.4/35
31/35
13.5/15
17.5/20
.87*35
32.5/35
32/25
32/35
31/35
17.5/20
30.5/35
.90*20
.92*30
28/30
27/30
18/20
(10+10+18.5+17.5+19+18.75+10)/(10+10+10+20+20+20+20)
160/6
212/(12+33)
212/(212+33)
214-73
24*4
q()
50*.78
185*.37
185-58
185-68
39+17
39+117
185+50
156/235
1304-970
734-617
334-117
(1304-734)-(970-617)
9981+4826
1040+4754
10040+4754
10001+4793
9990+4804
9971+4823
9962+4845
9890+4903
9861+4929
10000-158
10000-159
9842+4972
shared<- 4842+4972
shared
shared<- 9842+4972
shared
legcorpus<- 9861+4929
legcorpus
legfinal<- 9880+4927
legfinal
.95*3642
6740+4927+3042
6640+4944+3164
6673+4972+3027
5000+4680+4972
1304-970
734-617
334-117
334/1304
117/734
setwd("C:/Users/lmh735/Dropbox (Political Science)/HarbridgeYong Volden Wiseman/Replication Files")
##Libraries
##Install libraries if not already installed in R
library(haven)
library(tidyverse)
library(ggplot2)
library(gridExtra)
##Load data
h.les<- read_dta("HarbridgeYong_Volden_Wiseman_House_Replication.dta", .name_repair = "unique")
s.les<- read_dta("HarbridgeYong_Volden_Wiseman_Senate_Replication.dta", .name_repair = "unique")
setwd("C:/Users/lmh735/Dropbox (Political Science)/HarbridgeYong Volden Wiseman/Replication Files/Replication Output")
##################################################
##        Create key variables                  ##
##################################################
##correct Senate year
s.les$year_session<- s.les$year+1
summary(s.les$year_session)
##create same name for House
h.les$year_session<- h.les$year
summary(h.les$year_session)
###################################################
##                    Figures                    ##
###################################################
##Prep for figures
##Senate
s.year<- s.les %>%
select(year_session, mean_prop_cospon_opp_spon_SN, prop_co_bipart,
mean_prop_cospon_opp_spon_SN_nc, prop_co_bipart_nc,
mean_prop_cospon_opp_spon_SN_ss, prop_co_bipart_ss) %>%
filter(!is.na(year_session)) %>%
group_by (year_session) %>%
mutate(senate_mean_bipart_spon = mean(mean_prop_cospon_opp_spon_SN, na.rm=TRUE),
senate_mean_bipart_cospon = mean(prop_co_bipart, na.rm=TRUE),
senate_mean_bipart_spon_nc = mean(mean_prop_cospon_opp_spon_SN_nc, na.rm=TRUE),
senate_mean_bipart_cospon_nc = mean(prop_co_bipart_nc, na.rm=TRUE),
senate_mean_bipart_spon_ss = mean(mean_prop_cospon_opp_spon_SN_ss, na.rm=TRUE),
senate_mean_bipart_cospon_ss = mean(prop_co_bipart_ss, na.rm=TRUE)) %>%
distinct(year_session, .keep_all = T) %>%
select (year_session, senate_mean_bipart_spon, senate_mean_bipart_cospon,
senate_mean_bipart_spon_nc, senate_mean_bipart_cospon_nc,
senate_mean_bipart_spon_ss, senate_mean_bipart_cospon_ss)
##House
h.year<- h.les %>%
select(year_session, mean_prop_cospon_opp_spon_HR, prop_co_bipart,
mean_prop_cospon_opp_spon_HR_nc, prop_co_bipart_nc,
mean_prop_cospon_opp_spon_HR_ss, prop_co_bipart_ss) %>%
filter(!is.na(year_session)) %>%
group_by (year_session) %>%
mutate(house_mean_bipart_spon = mean(mean_prop_cospon_opp_spon_HR, na.rm=TRUE),
house_mean_bipart_cospon = mean(prop_co_bipart, na.rm=TRUE),
house_mean_bipart_spon_nc = mean(mean_prop_cospon_opp_spon_HR_nc, na.rm=TRUE),
house_mean_bipart_cospon_nc = mean(prop_co_bipart_nc, na.rm=TRUE),
house_mean_bipart_spon_ss = mean(mean_prop_cospon_opp_spon_HR_ss, na.rm=TRUE),
house_mean_bipart_cospon_ss = mean(prop_co_bipart_ss, na.rm=TRUE)) %>%
distinct(year_session, .keep_all = T) %>%
select (year_session, house_mean_bipart_spon, house_mean_bipart_cospon,
house_mean_bipart_spon_nc, house_mean_bipart_cospon_nc,
house_mean_bipart_spon_ss, house_mean_bipart_cospon_ss)
##########################
##combine H and S year-level data
data.year<- h.year %>%
left_join(s.year, by="year_session", copy=FALSE, suffix=c("", ""))
data.year
###########################
##Stack H and S year-level data for ggplot
h.year2<- h.year
h.year2$Chamber<- "House"
s.year2<- s.year
s.year2$Chamber<- "Senate"
names(h.year2)<- c("year_session","mean_bipart_spon", "mean_bipart_cospon",
"mean_bipart_spon_nc", "mean_bipart_cospon_nc",
"mean_bipart_spon_ss",  "mean_bipart_cospon_ss",
"Chamber")
names(s.year2)<- c("year_session","mean_bipart_spon", "mean_bipart_cospon",
"mean_bipart_spon_nc", "mean_bipart_cospon_nc",
"mean_bipart_spon_ss",  "mean_bipart_cospon_ss",
"Chamber")
data.year.stack<- rbind(h.year2, s.year2)
##########################
##########################
##Figure A1 - Average proportion bipartisan cosponsors attracted
##All bills
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("All Bills")
ggsave("FigA1_Avg_bipart_spon_year.png", height=6, width=8)
##Figure A1 - Average proportion bipartisan cosponsors attracted
##All bills
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("All Bills")
##Figure A1 - Average proportion bipartisan cosponsors attracted
##All bills
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("All Bills")
ggsave("FigA1_Avg_bipart_spon_year.png", height=6, width=8)
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("All Bills")
ggsave("FigA1_Avg_bipart_spon_year.png", height=6, width=8)
#####################
##Figure A2 - Average proportion bipartisan cosponsors attracted
##S&S bills only
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon_ss, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("S&S Bills")
ggsave("FigA2_Avg_bipart_spon_year_ss.png", height=6, width=8)
############################################
############################################
##Prep for boxplots
##Drop NA from year
h.les.clean<- h.les %>%
filter(!is.na(year_session))
s.les.clean<- s.les %>%
filter(!is.na(year_session))
remove(h.year)
remove(s.year)
remove(h.year2)
remove(s.year2)
remove(h.les.clean)
remove(s.les.clean)
remove(data.year)
remove(data.year.stack)
remove(h.les)
remove(s.les)
setwd("C:/Users/lmh735/Dropbox (Political Science)/HarbridgeYong Volden Wiseman/Replication Files")
##Load data
h.les<- read_dta("HarbridgeYong_Volden_Wiseman_House_Replication.dta", .name_repair = "unique")
s.les<- read_dta("HarbridgeYong_Volden_Wiseman_Senate_Replication.dta", .name_repair = "unique")
setwd("C:/Users/lmh735/Dropbox (Political Science)/HarbridgeYong Volden Wiseman/Replication Files/Replication Output")
##correct Senate year
s.les$year_session<- s.les$year+1
summary(s.les$year_session)
##create same name for House
h.les$year_session<- h.les$year
summary(h.les$year_session)
####################
##Prep for figures
##Senate
s.year<- s.les %>%
select(year_session, mean_prop_cospon_opp_spon_SN, prop_co_bipart,
mean_prop_cospon_opp_spon_SN_nc, prop_co_bipart_nc,
mean_prop_cospon_opp_spon_SN_ss, prop_co_bipart_ss) %>%
filter(!is.na(year_session)) %>%
group_by (year_session) %>%
mutate(senate_mean_bipart_spon = mean(mean_prop_cospon_opp_spon_SN, na.rm=TRUE),
senate_mean_bipart_cospon = mean(prop_co_bipart, na.rm=TRUE),
senate_mean_bipart_spon_nc = mean(mean_prop_cospon_opp_spon_SN_nc, na.rm=TRUE),
senate_mean_bipart_cospon_nc = mean(prop_co_bipart_nc, na.rm=TRUE),
senate_mean_bipart_spon_ss = mean(mean_prop_cospon_opp_spon_SN_ss, na.rm=TRUE),
senate_mean_bipart_cospon_ss = mean(prop_co_bipart_ss, na.rm=TRUE)) %>%
distinct(year_session, .keep_all = T) %>%
select (year_session, senate_mean_bipart_spon, senate_mean_bipart_cospon,
senate_mean_bipart_spon_nc, senate_mean_bipart_cospon_nc,
senate_mean_bipart_spon_ss, senate_mean_bipart_cospon_ss)
##House
h.year<- h.les %>%
select(year_session, mean_prop_cospon_opp_spon_HR, prop_co_bipart,
mean_prop_cospon_opp_spon_HR_nc, prop_co_bipart_nc,
mean_prop_cospon_opp_spon_HR_ss, prop_co_bipart_ss) %>%
filter(!is.na(year_session)) %>%
group_by (year_session) %>%
mutate(house_mean_bipart_spon = mean(mean_prop_cospon_opp_spon_HR, na.rm=TRUE),
house_mean_bipart_cospon = mean(prop_co_bipart, na.rm=TRUE),
house_mean_bipart_spon_nc = mean(mean_prop_cospon_opp_spon_HR_nc, na.rm=TRUE),
house_mean_bipart_cospon_nc = mean(prop_co_bipart_nc, na.rm=TRUE),
house_mean_bipart_spon_ss = mean(mean_prop_cospon_opp_spon_HR_ss, na.rm=TRUE),
house_mean_bipart_cospon_ss = mean(prop_co_bipart_ss, na.rm=TRUE)) %>%
distinct(year_session, .keep_all = T) %>%
select (year_session, house_mean_bipart_spon, house_mean_bipart_cospon,
house_mean_bipart_spon_nc, house_mean_bipart_cospon_nc,
house_mean_bipart_spon_ss, house_mean_bipart_cospon_ss)
##Stack H and S year-level data for ggplot
h.year2<- h.year
h.year2$Chamber<- "House"
s.year2<- s.year
s.year2$Chamber<- "Senate"
names(h.year2)<- c("year_session","mean_bipart_spon", "mean_bipart_cospon",
"mean_bipart_spon_nc", "mean_bipart_cospon_nc",
"mean_bipart_spon_ss",  "mean_bipart_cospon_ss",
"Chamber")
names(s.year2)<- c("year_session","mean_bipart_spon", "mean_bipart_cospon",
"mean_bipart_spon_nc", "mean_bipart_cospon_nc",
"mean_bipart_spon_ss",  "mean_bipart_cospon_ss",
"Chamber")
data.year.stack<- rbind(h.year2, s.year2)
##Figure A1 - Average proportion bipartisan cosponsors attracted
##All bills
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("All Bills")
ggsave("FigA1_Avg_bipart_spon_year.png", height=6, width=8)
#####################
##Figure A2 - Average proportion bipartisan cosponsors attracted
##S&S bills only
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon_ss, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("S&S Bills")
ggsave("FigA2_Avg_bipart_spon_year_ss.png", height=6, width=8)
############################################
############################################
##Prep for boxplots
##Drop NA from year
h.les.clean<- h.les %>%
filter(!is.na(year_session))
s.les.clean<- s.les %>%
filter(!is.na(year_session))
#################
##Figure 1 - BOXPLOT of proportion bipartisan cosponsors attracted
##House, all bills
h.bipart.spon<- ggplot(h.les.clean, aes(x=as.factor(year_session), y=mean_prop_cospon_opp_spon_HR)) +
geom_boxplot(outlier.shape = NA) +
theme(axis.text=element_text(size=11, angle=90), axis.title.y = element_text(size = 11),
plot.title = element_text(size=11))+
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
ggtitle("House")
##Senate, all bills
s.bipart.spon<- ggplot(s.les.clean, aes(x=as.factor(year_session), y=mean_prop_cospon_opp_spon_SN)) +
geom_boxplot(outlier.shape = NA) +
theme(axis.text=element_text(size=11, angle=90), axis.title.y = element_text(size = 11),
plot.title = element_text(size=11))+
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
ggtitle("Senate")
##Combine House and Senate
grid.arrange(h.bipart.spon, s.bipart.spon, nrow=2)
bipart.spon<- arrangeGrob(h.bipart.spon, s.bipart.spon, nrow=2)
ggsave("Fig1_bipart_spon_H_S_combine_year.png", bipart.spon, height=11, width=8)
##Figure A1 - Average proportion bipartisan cosponsors attracted
##All bills
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("All Bills")
ggsave("FigA1_Avg_bipart_spon_year.png", height=6, width=8)
#####################
##Figure A2 - Average proportion bipartisan cosponsors attracted
##S&S bills only
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon_ss, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("S&S Bills")
ggsave("FigA2_Avg_bipart_spon_year_ss.png", height=6, width=8)
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("All Bills")
ggsave("FigA1_Avg_bipart_spon_year.png", height=6, width=8)
ggplot(data=data.year.stack, aes(x=year_session, y=mean_bipart_spon_ss, group=Chamber)) +
geom_line(aes(linetype=Chamber))+
scale_y_continuous(limits=c(0,.6)) +
xlab("Year Congress Began") +
ylab("Proportion Bipartisan \nCosponsors Attracted") +
##ggtitle("S&S Bills")
ggsave("FigA2_Avg_bipart_spon_year_ss.png", height=6, width=8)
q()
